<?php

/**
 * AdminMediaPath class for imgres Urls of phpinchains based xics core modules
 *
 * @author macmillan
 */
class AdminMediaPath {

    private $ctx;
    private $module;

    public function __construct (base_ApplicationContext $ctx) {
        $this->ctx = $ctx;
        $this->module = preg_replace('#adminmod/#', '', phpinchains_RuntimeConfig::getInstance()->get('moduleParam'));
    }

    /**
     * Path to legacy module images
     * @return string
     */
    public function main () {
       return $this->ctx->cfgPath('imgresUrl');
    }

    /**
     * Path to core images (located in the core module folder
     * @return string
     */
    public function core () {
        return $this->ctx->cfgPath('imgresUrl').'modules/core/';
    }

    /**
     * Path to images of current module
     * @return string
     */
    public function mod () {
        return $this->ctx->cfgPath('imgresUrl').'modules/'.$this->module.'/';
    }

}
?>
